from django.db import models

# Create your models here.
class Rider(models.Model):
    """
    骑手信息表
    """
    users = models.ForeignKey('users.Users', related_name='rider', on_delete=models.CASCADE)
    id_card = models.CharField(max_length=18, verbose_name='身份证号', null=False)
    real_name = models.CharField(max_length=20, verbose_name='真实姓名', null=False)
    phone = models.CharField(max_length=11, verbose_name='手机号码', null=False)
    workplace = models.CharField(max_length=50, verbose_name='工作地点', null=False)
    add_time = models.DateTimeField(verbose_name="添加时间", auto_now=True)

    def __str__(self):
        return self.users.username